import service from "@/utils/request"
import type { categoryListModel } from './model/category'

enum API {
  // 一级分类
  getCategory1 = '/admin/product/getCategory1',
  getCategory2 = '/admin/product/getCategory2',
  getCategory3 = '/admin/product/getCategory3',
}

// 获取一级分类
export const reqGetCategory1 = () => service.get<any, categoryListModel>(API.getCategory1)

// 获取二级分类
export const reqGetCategory2 = (category1Id: number) => service.get<any, categoryListModel>(`${API.getCategory2}/${category1Id}`)

// 获取二级分类
export const reqGetCategory3 = (category2Id: number) => service.get<any, categoryListModel>(`${API.getCategory3}/${category2Id}`)
